<script setup lang="ts">
import { tableConfig } from './config/table-config';
import { doGetProcessList } from '@/api/plan/scheduling/index';
import { generateNameToLevel } from '@/config/constant';
import type { record } from '@/api/plan/task/model/type';

const detailVisible = ref(false);
const { getMaxHeight, handleFullscreen } = useModal();

// 查询表格参数
const addedParams = ref({
    materialCode: '',
    orderNumber: ''
});

// 打开弹框
const open = (params: record) => {
    const { orderNumber, itemNumber } = params;
    addedParams.value = {
        materialCode: itemNumber,
        orderNumber
    };

    detailVisible.value = true;
};

defineExpose({
    open
});
</script>
<template>
    <q-modal
        v-model:visible="detailVisible"
        title="工序计划明细"
        :fullscreen="true"
        :footer="false"
        width="1100px"
        @fullscreen="handleFullscreen"
    >
        <base-table
            :id="generateNameToLevel('2')"
            :tableConfig="tableConfig"
            :get-data-fn="doGetProcessList"
            :added-params="addedParams"
            :modal-mode="true"
            :un-action="true"
            :max-height="getMaxHeight"
            :show-setting="false"
        >
        </base-table>
    </q-modal>
</template>

<style scoped></style>
